package com.book.controller;


import com.book.DUtils.QueryPageParam;
import com.book.DUtils.Res;
import com.book.entity.User;
import com.book.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-10-14
 */
@RestController
@RequestMapping("/book/user")
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping("/list")
    public Res list(){
        return Res.sucess(userService.list());
    }

    @PostMapping("/listPage")
    public List<User> listPage(@RequestBody QueryPageParam query){
        System.out.println(query);
        System.out.println(query.getPageSize());
        System.out.println(query.getPageNum());
        return null;
    }

//    @PostMapping("/listMap")
//    public List<User> listMap(@RequestBody HashMap map){
//        System.out.println(map);
//        return null;
//    }
}

